qx.Class.define("ui.view.MainWindow", {
			events : {
				"refreshTema" : "qx.event.type.Data",
				"agregarTema" : "qx.event.type.Data",
				"borrarTema" : "qx.event.type.Data"
			},
			extend : qx.ui.window.Window,
			construct : function(bienvenida) {
				this.base(arguments, bienvenida, "resource/ui/test.png");
				this.setContentPadding(0);
				var layout = new qx.ui.layout.Grid();
				this.setLayout(layout);
				this.set({
							showClose : false,
							showMinimize : false,
							showMaximize : false
						});
				// Add a TabView
				var tabView = new qx.ui.tabview.TabView;
				this.add(tabView, {
							column : 0,
							row : 0
						});
				layout.setRowFlex(0, 1);
				layout.setColumnFlex(0, 1);
				this.pageTema = new ui.view.PageTema();
				tabView.add(this.pageTema);
				this.initPageTema();
				this.pageNews = new ui.view.PageNews();
				tabView.add(this.pageNews);
				this.initPageNews();

				this.pageNwNews = new ui.view.PageNwNews();
				tabView.add(this.pageNwNews);
			},
			members : {
				pageTema : null,
				serviceTema : null,
				controllerTema : null,
				initPageTema : function() {
					this.serviceTema = new ui.service.TemaService();
					this.serviceTema.addListener("nuevosTemas", function(e) {
								this.debug(qx.dev.Debug.debugProperties(e
										.getData()));
							}, this);

					// reload handling
					this.pageTema.addListener("reloadTema", function() {
								this.serviceTema.list();
							}, this);

					// post handling
					/*
					 * main.addListener("post", function(e) {
					 * service.post(e.getData()); }, this);
					 */

					// create the controller
					this.controllerTema = new qx.data.controller.List(null,
							this.pageTema.getList());
					this.controllerTema.setLabelPath("nombre");

					this.serviceTema
							.bind("temas", this.controllerTema, "model");

					// start the loading on startup
					this.serviceTema.list();

				},
				pageNews : null,
				serviceNews : null,
				controllerNews : null,
				initPageNews : function() {
					this.serviceNews = new ui.service.NoticiasService();
					this.serviceNews.addListener("nuevasNoticias", function(e) {
								this.debug(qx.dev.Debug.debugProperties(e
										.getData()));
							}, this);

					// reload handling
					this.pageNews.addListener("reloadNews", function() {
								this.serviceNews.list();
							}, this);

					// post handling
					/*
					 * main.addListener("post", function(e) {
					 * service.post(e.getData()); }, this);
					 */

					// create the controller
					this.controllerNews = new qx.data.controller.List(null,
							this.pageNews.getList());
					this.controllerNews.setLabelPath("titulo");

					this.serviceNews.bind("noticias", this.controllerNews,
							"model");

					// start the loading on startup
					this.serviceNews.list();

				}
			}

		});